package com.dragon.logical.service.finance;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dragon.repository.entity.AddPageData;
import com.dragon.repository.entity.DictsortDetail;
import com.dragon.repository.entity.Loan;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 借款表 服务类
 * </p>
 *
 * @author sy
 * @since 2023-07-03
 */
public interface ILoanService extends IService<Loan> {

    Page<Loan> loanList(Integer page, Integer limit, String search,Integer status,String startTime, String endTime);

    AddPageData addLoan(Loan loan);

    void updateLoan(Loan loan);

    void deleteLoan(Integer id);

    Loan getLoanById(Integer id);

    /**
     * 借款统计
     * @return
     */
    Map<String,Object> selectListStatistics();

    /**
     * 借款类型占比
     * @param time
     * @return
     */
    List<DictsortDetail> loanTypePercentage(String time);

    /**
     * 借款月总额统计
     * @param time
     * @return
     */
    LinkedHashMap<String,Object> loanMonthlyStatistics(String time);
}
